// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init()

// 云函数入口函数
exports.main = async (event, context) => {
  //实例化数据库连接
  const db = cloud.database()
  //接收结果
  var swiper_img = []

  await db.collection('swiper')
  .get()
  .then(res =>{
    swiper_img = res.data
  })
  var result = {}
  result.errCode = 0
  result.errMsg = 'ok'

  var data = {}
    data.swiper_img = swiper_img
    
    result.data = data
    return result
}